{include file="Public:header2"/}

<body>
<div class="layui-fluid">
    <div class="layui-card">
        <form method="get" class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <div class="layui-input-block" style="margin-left: 0px">
                        <input type="text" name="uid" value="{$Think.get.uid}" placeholder="会员uid" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-inline">
                    <div class="layui-input-block" style="margin-left: 0px">
                        <select name="status" style="width:100%;">
                            <option value="">--请选择状态--</option>
                            <option value="1" {if condition="$Request.get.status eq 1"}selected{/if}>待发货</option>
                            <option value="2" {if condition="$Request.get.status eq 2"}selected{/if}>待收货</option>
                            <option value="3" {if condition="$Request.get.status eq 3"}selected{/if}>已收货</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline" >
                    <div class="layui-input-inline" style="width: 300px;margin-left: 0px">
                        <input type="text" id="pay_time" name="pay_time" value="{$Think.get.pay_time}" class="layui-input" placeholder="支付时间" autocomplete="off" >
                    </div>
                </div>
                <div class="layui-inline" >
                    <div class="layui-input-inline" style="width: 300px;margin-left: 0px">
                        <input type="text" name="order_no" value="{$Think.get.order_no}" class="layui-input" placeholder="订单号" autocomplete="off" >
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="LAY-user-front-search">
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>
            </div>
        </form>

        <div class="layui-card-body">
            <xblock>
                <div style="padding-bottom: 10px;">
                    <span style="line-height:40px;float:right;">共有数据： {$count}条</span>
                </div>
            </xblock>
            <table class="layui-table" style="text-align:center">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>用户信息</th>
                    <th>订单号</th>
                    <th>价格明细</th>
                    <th>收货信息</th>
                    <th>物流信息</th>
                    <th>订单状态</th>
                    <th>支付时间</th>
                    <th>留言</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                    {volist name="list" id="vo"}
                        <tr>
                            <td>{$vo['id']}</td>
                            <td style="text-align: left">
                                <div style="display: flex;">
                                    <div><img src="{:imageUrl($vo['headimg'])}" alt="" width="50px" height="50px"></div>
                                    <div style="margin-left: 10px">
                                        <p style="color: #ff5722c2;font-size: 9px">UID：{$vo['user_id']+888}</p>
                                        <p style="color: #666666ba;font-size: 9px">{$vo['nickname']}</p>
                                    </div>
                                </div>
                            </td>
                            <td>{$vo['order_no']}</td>
                            <td style="text-align: left;width: 150px">
                                <div style="display: flex;font-weight: bold;"><p style="width: 60px;display: inline">商品总价</p> ：￥{$vo['total_price']}</div>
                                <div style="display: flex;font-weight: bold;"><p style="width: 60px;display: inline">运费</p> ：￥{$vo['freight_price']}</div>
                                <div style="display: flex;font-weight: bold;"><p style="width: 60px;display: inline">微信</p> ：￥{$vo['price']}</div>
                                <div style="display: flex;font-weight: bold;"><p style="width: 60px;display: inline">余额</p> ：￥{$vo['money']}</div>
                                <!--<div style="display: flex;font-weight: bold;"><p style="width: 60px;display: inline">Woo币</p> ：￥{$vo['integral']}</div>-->
                            </td>
                            <td style="text-align: left;width: 160px">
                                <p style="font-weight: bold">{$vo['address']['shou_name']} {$vo['address']['shou_mobile']}</p>
                                <p>{$vo['address']['shou_region']}</p>
                                <p>{$vo['address']['address']}</p>
                            </td>
                            <td style="text-align: left;">
                                {if $vo['address']['delivery_no']}
                                <p>物流公司：{$vo['address']['delivery_name']}</p>
                                <p>物流单号：{$vo['address']['delivery_no']}</p>
                                {/if}
                            </td>
                            <td>
                                {if $vo['status'] eq 1 /}
                                <button class="layui-btn layui-btn-normal layui-btn-radius layui-btn-sm">待发货</button>
                                {elseif $vo['status'] eq 2 /}
                                <button class="layui-btn layui-btn-success layui-btn-radius layui-btn-sm">待收货</button>
                                {elseif $vo['status'] eq 3 /}
                                <button class="layui-btn layui-btn-danger layui-btn-radius layui-btn-sm">已收货</button>
                                {/if}
                            </td>
                            <td style="width: 130px">
                                <p>{$vo['pay_time']|date="Y-m-d H:i:s"}</p>
                            </td>
                            <td>{$vo.content}</td>
                            <td style="width: 200px">
                                {if $vo['status'] eq 1}
                                <a style="text-decoration:none" title="发货" onClick="deliver({$vo.id})" class="layui-btn layui-btn-info layui-btn-xs">发货</a>
                                {/if}
                                {if $vo['status'] eq 2}
<!--                                <a style="text-decoration:none" title="查物流" onClick="logistics({$vo.id})" class="layui-btn layui-btn-danger layui-btn-xs">查物流</a>-->
                                {/if}
                                <a title="查看详情"  onClick="detail({$vo.id})"  class="layui-btn layui-btn-normal layui-btn-xs">查看详情</a>
                            </td>
                        </tr>
                    {/volist}
                
                        {if condition="empty($list)"}
                            <tr><td colspan='10' style="text-align:center;">暂时没有数据！</td></tr>
                        {/if}
                </tbody>
            </table>
            <div class="layui-box layui-laypage layui-laypage-default">
                {$page|raw}
            </div>
        </div>
    </div>
</div>
{include file="Public:footer"/}
<script type="text/javascript">
    layui.use(['table','laydate'], function(){
        var laydate = layui.laydate;
        laydate.render({
            elem: '#pay_time'
            ,type: 'datetime'
            ,range: true
        });
    });

    //详情
    function detail(id) {
        var url  = "{:url('/admin/kk_send_order_detail?id="+id+"')}";
        layer.open({
            type: 2,
            title: '商品详情',
            shadeClose: false,
            shade: 0.3,
            area: ['900px', '800px'],
            content: url,
        });
    }

    //发货
    function deliver(id){
        var url  = "{:url('/admin/kk_send_order_deliver?id="+id+"')}";
        layer.open({
            type: 2,
            title: '发货',
            shadeClose: false,
            shade: 0.3,
            area: ['480px', '480px'],
            content: url,
        });
    }



    //查物流
    function logistics(id) {
        var url  = "{:url('/admin/send_order_logistics?id="+id+"')}";
        layer.open({
            type: 2,
            title: '物流轨迹',
            shadeClose: false,
            shade: 0.3,
            area: ['900px', '800px'],
            content: url,
        });
    }


</script>
</body>
</html>


